/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
    string text;
    getline(cin, text);
    vector<string> words;
    string word = "";
    for (char c : text) 
{
        if (c == ' ') 
        {
            words.push_back(word);
            word = "";
        } 
        else word += c;
 }
    words.push_back(word);

    int count = 0;
    for (const auto& w : words)
 {
        if (isupper(w[0])) count++;
 }
    cout <<  count ;
    return 0;
}
